/*
 * Copyright (C) 2001-2008  Nishanth Menon <menon.nishanth at gmail dot com>
 *
 * Part of the predict two project done during NITC Final year.
 * Predict2: http://code.google.com/p/predict2/
 * NITC: http://web.nitc.ac.in/~cse/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
 */


/*
 * DisplayForm.java
 *
 * Created on September 26, 2001, 2:08 AM
 */


/**
 *
 * @author  lazarus
 * @version 1.01
 */
package GUI;
public class DisplayForm extends javax.swing.JDialog
{

    /** Creates new form DisplayForm */
    public DisplayForm (java.awt.Frame parent, boolean modal)
    {
        super (parent, modal);
        initComponents ();
        pack ();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the FormEditor.
     */
    private void initComponents ()
    {                           // GEN-BEGIN:initComponents
        BasePanel = new javax.swing.JPanel ();
        QuitButton = new javax.swing.JButton ();
        jScrollPane1 = new javax.swing.JScrollPane ();
        DisplayArea = new javax.swing.JTextArea ();
        HeadingLabel = new javax.swing.JLabel ();
        getContentPane ().setLayout (new javax.swing.BoxLayout (getContentPane (), 0));
        setName ("Display Form");
        setTitle ("Data Display");
        addWindowListener (new java.awt.event.WindowAdapter ()
                           {
                           public void windowClosing (java.awt.event.WindowEvent evt)
                           {
                           closeDialog (evt);
                           }
                           }
        );

        BasePanel.setLayout (null);
        BasePanel.setPreferredSize (new java.awt.Dimension (660, 440));
        BasePanel.setMinimumSize (new java.awt.Dimension (660, 400));
        BasePanel.setForeground (java.awt.Color.white);
        BasePanel.setBackground (java.awt.Color.black);

        QuitButton.setToolTipText ("Click This To Quit the Zone Server Program");
        QuitButton.setBorder (new javax.swing.border.BevelBorder (0));
        QuitButton.setName ("QuitButton");
        QuitButton.setForeground (java.awt.Color.red);
        QuitButton.setActionCommand ("QuitButton");
        QuitButton.setFont (new java.awt.Font ("TimesNewRoman", 1, 14));
        QuitButton.setText ("Quit");
        QuitButton.setBackground (java.awt.Color.darkGray);
        QuitButton.addMouseListener (new java.awt.event.MouseAdapter ()
                                     {
                                     public void mouseClicked (java.awt.event.MouseEvent evt)
                                     {
                                     QuitButtonMouseClicked (evt);
                                     }
                                     }
        );
        BasePanel.add (QuitButton);
        QuitButton.setBounds (230, 370, 210, 30);



        DisplayArea.setToolTipText ("View the Information of Various Connections Here");
        DisplayArea.setEditable (false);
        DisplayArea.setCaretColor (java.awt.Color.red);
        DisplayArea.
            setText
            ("uasillkaflsdfasdlsdlkhsdlkasdlkasldasdlkahsdlkasdlkasdflkasdfklajslsfhaslkdsdlkfasdkljshflkjshflaksfalskdalksd\nsdfasfa.sfd\nsdf,aksfsdf\nasdf\nasdf\nasdf\nasd\nfa\nf\nasd\nasd\nfs\ndf\nsdf\nsd\nf\nsdfas\ndf\nsd\n\n\naf\nsdf\nasd\nf\naf\na\ndsf\nas\ndf\nasdf\nas\ndfa\nsf\nd\nfas\ndf");
        DisplayArea.setBackground (java.awt.Color.cyan);
        jScrollPane1.setViewportView (DisplayArea);

        BasePanel.add (jScrollPane1);
        jScrollPane1.setBounds (20, 110, 610, 230);


        HeadingLabel.setBorder (new javax.swing.border.
                                CompoundBorder (new javax.swing.border.SoftBevelBorder (0),
                                                new javax.swing.border.EtchedBorder ()));
        HeadingLabel.setText ("Kuberan Connection Information");
        HeadingLabel.setForeground (java.awt.Color.green);
        HeadingLabel.setHorizontalAlignment (javax.swing.SwingConstants.CENTER);
        HeadingLabel.setFont (new java.awt.Font ("Gothic", 0, 18));
        BasePanel.add (HeadingLabel);
        HeadingLabel.setBounds (20, 30, 610, 50);


        getContentPane ().add (BasePanel);

        pack ();
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit ().getScreenSize ();
        java.awt.Dimension dialogSize = getSize ();
        setSize (new java.awt.Dimension (300, 200));
        setLocation ((screenSize.width - 300) / 2, (screenSize.height - 200) / 2);
    }                           // GEN-END:initComponents

    private void QuitButtonMouseClicked (java.awt.event.MouseEvent evt)
    {                           // GEN-FIRST:event_QuitButtonMouseClicked
// Add your handling code here:
        System.exit (1);
    }                           // GEN-LAST:event_QuitButtonMouseClicked

    /** Closes the dialog */
    private void closeDialog (java.awt.event.WindowEvent evt)
    {                           // GEN-FIRST:event_closeDialog
        setVisible (false);
        dispose ();
    }                           // GEN-LAST:event_closeDialog

   /** Call this to Update the text on Screen*/
    public void setText (String Message)
    {
        String ToPut = "Sorry! Nothing to Display";

        // System.out.println ("Message=" + Message);
        if ((Message != null))
            if (Message.length () != 0)
                ToPut = Message;
        // System.out.println ("setting as" + ToPut);
        DisplayArea.setText (ToPut);
    }


    /**
    * @param args the command line arguments
    */
    public static void main (String args[])
    {
        new DisplayForm (new javax.swing.JFrame (), true).show ();
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel BasePanel;
    private javax.swing.JButton QuitButton;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea DisplayArea;
    private javax.swing.JLabel HeadingLabel;

    // End of variables declaration//GEN-END:variables

}
